package com.mine.dubbo.netty;

import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(NettyClientConfigurationProperties.class)
@Log4j2
public class NettyClientAutoConfiguration {
    @Autowired
    private NettyClientConfigurationProperties nettyClientConfigurationProperties;

    @Bean
    public Client client() {
        return new Client(nettyClientConfigurationProperties.getRemoteHost(),
                nettyClientConfigurationProperties.getRemotePort());
    }
}
